package com.leonardo.beanme;

public class BeanmeUtils {

	public static boolean isNullOrEmpty(String str) {
		return str == null || str.length() == 0;
	}
	
	public static String getGetterStr(String name) {
		return getAccessor("get", name);
	}
	
	public static String getSetterStr(String name) {
		return getAccessor("set", name);
	}
	
	private static String getAccessor(String start, String name) {
		if(isNullOrEmpty(name))
			return start;
		String accessor = start + Character.toUpperCase(name.charAt(0));
		if(name.length() > 1)
			accessor += name.substring(1);
		return accessor;
	}
	
}
